package xx.iverson.school_manage.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import xx.iverson.school_manage.entity.Points;
import xx.iverson.school_manage.service.PointsService;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author wei77
 */
@Controller
public class PointsController {
    @Resource
    private PointsService pointsService;

    // 重置积分为100
    @RequestMapping("resetPoints")
    @ResponseBody
    public boolean resetPoints() {
        return pointsService.resetPoints();
    }
    // 重置积分为0
    @RequestMapping("resetPointsZero")
    @ResponseBody
    public boolean resetPointsZero() {
        return pointsService.resetPointsZero();
    }

    // 查询所有人积分
    @RequestMapping("getAllPoints")
    @ResponseBody
    public List<Points> getAllPoints() {
        return pointsService.getListPoints(0);
    }
}
